home *** CD-ROM | disk | FTP | other *** search
-
- SHMGET(2) UNIX Programmer's Manual SHMGET(2)
-
- NNAAMMEE
- sshhmmggeett - get shared memory area identifier
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//iippcc..hh>>
- ##iinncclluuddee <<ssyyss//sshhmm..hh>>
-
- _i_n_t
- sshhmmggeett(_k_e_y___t _k_e_y, _i_n_t _s_i_z_e, _i_n_t _s_h_m_f_l_g)
-
- DDEESSCCRRIIPPTTIIOONN
- sshhmmggeett() returns the shared memory identifier associated with the key
- _k_e_y.
-
- A shared memory segment is created if either _k_e_y is equal to IPC_PRIVATE,
- or _k_e_y does not have a shared memory segment identifier associated with
- it, and the IPC_CREAT bit is set in _s_h_m_f_l_g_.
-
- If a new shared memory segment is created, the data structure associated
- with it (the _s_h_m_i_d___d_s structure, see shmctl(2)) is initialized as fol-
- lows:
-
- ++oo _s_h_m___p_e_r_m_._c_u_i_d and _s_h_m___p_e_r_m_._u_i_d are set to the effective uid of the
- calling process.
-
- ++oo _s_h_m___p_e_r_m_._g_i_d and _s_h_m___p_e_r_m_._c_g_i_d are set to the effective gid of the
- calling process.
-
- ++oo _s_h_m___p_e_r_m_._m_o_d_e is set to the lower 9 bits of _s_h_m_f_l_g.
-
- ++oo _s_h_m___l_p_i_d, _s_h_m___n_a_t_t_c_h, _s_h_m___a_t_i_m_e, and _s_h_m___d_t_i_m_e are set to 0
-
- ++oo _s_h_m___c_t_i_m_e is set to the current time.
-
- ++oo _s_h_m___s_e_g_s_z is set to the value of _s_i_z_e.
-
- RREETTUURRNN VVAALLUUEESS
- Upon successful completion a positive shared memory segment identifier is
- returned. Otherwise, -1 is returned and the global variable _e_r_r_n_o is set
- to indicate the error.
-
- EERRRROORRSS
- [EACESS] A shared memory segment is already associated with _k_e_y and
- the caller has no permission to access it.
-
- [EEXIST] Both IPC_CREAT and IPC_EXCL are set in _s_h_m_f_l_g, and a shared
- memory segment is already associated with _k_e_y.
-
- [ENOSPC] A new shared memory indentifier could not be created be-
- cause the system limit for the number of shared memory
- identifiers has been reached.
-
- [ENOENT] IPC_CREAT was not set in _s_h_m_f_l_g and no shared memory seg-
- ment associated with _k_e_y was found.
-
- [ENOMEM] There is not enough memory left to created a shared memory
- segment of the requested size.
-
- SSEEEE AALLSSOO
- shmctl(2), shmat(2), shmdt(2)
-
- NetBSD August 17, 1995 1
-